﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using Defero.Core;
using Defero.Core.DomainObjects;
using Defero.Core.Entities;
using Defero.Core.Repositories;
namespace Defero.Domain.Objects
{
    /// <summary>
    /// Administrador de bugs.
    /// </summary>
    public class BugTracker : IBugTracker
    {
        /// <summary>
        /// Repositorio de Datos.
        /// </summary>
        protected readonly IBugTrackerRepository CommandRepository;
        /// <summary>
        /// Repositorio de Querys.
        /// </summary>
        protected readonly IBugTrackerQueryRepository QueryRepository;
        /// <summary>
        /// Constructor default.
        /// </summary>
        public BugTracker(IBugTrackerRepository commandRepository, 
                          IBugTrackerQueryRepository queryRepository) 
        {
            CommandRepository = commandRepository;
            QueryRepository = queryRepository;
        }
        /// <summary>
        /// Regresa una lista con los bugs asignados a determinado usuario.
        /// </summary>
        /// <param name="userId">Id del usuario asignado.</param>
        /// <param name="status">Status del bug.</param>
        public IEnumerable<Core.DataTransferObjects.BugHeader> GetBugs() 
        {
            var userId = Guid.Parse("41E09EF1-45E2-4189-97B2-9AD064212D86");
            return QueryRepository.GetBugs(userId, BugStatus.New, BugStatus.Working, BugStatus.ReWorking);
        }

    }

}
